#pragma once


/// Tries to parse command line argumets
class ArgsParser
{
public:
	/// Type of server implementation
	enum ServerType
	{
		Multithread,
		SingleDispatcher,
		Simple,
	};
	
	/// Creates parser for the given arguments
	/// In case of error throws std::exception
	ArgsParser(int argc, const char *argv[]);

	/// Returns the port to use for incoming connections
	unsigned short getPort() const { return _port; }

	/// Returns whether the server shows statistics
	bool getShowStat() const { return _showStat; }

	/// Returns number of query dispatching threads on the server
	size_t getServerThreadCount() const { return _serverThreadCount; }

	/// Returns type of the server
	ServerType getServerType() const { return _serverType; }

private:
	size_t _serverThreadCount;
	ServerType _serverType;
	bool _showStat;
	unsigned short _port;
};